package com.bby.disk.service;

import com.bby.common.exception.BBYException;
import com.bby.common.model.FileReport;
import com.bby.disk.bean.vo.SearchFileVO;
import com.bby.disk.bean.vo.UserRootsVO;
import com.bby.disk.bean.vo.VirtualFileList;
import com.bby.disk.bean.req.EditPermissionReq;
import com.bby.disk.bean.req.FileActionReq;
import com.bby.disk.bean.vo.FileActionResult;
import com.bby.disk.manager.virtual.VirtualDirectory;
import com.bby.disk.manager.virtual.VirtualObjNotFoundException;
import com.bby.disk.manager.virtual.VirtualObject;
import com.bby.disk.manager.virtual.VirtualPath;

import java.util.List;

public interface IFileService {
    /**
     * 获取文件列表
     * @param userId 访问者id
     * @param path 目录，以拥有者id开头
     * @return
     */
    VirtualFileList getFileList(String userId, VirtualPath path) throws BBYException;
    
    /**
     * 获取文件列表
     * @param userId 访问者id
     * @param fileId 目录id
     * @return
     */
    VirtualFileList getFileList(String userId, String fileId) throws BBYException;

    /**
     * 重命名：(文件、目录)写
     * @return
     */
    FileActionResult renameFile(String userId, FileActionReq action) throws BBYException;

    FileActionResult copyAndMove(String userId, FileActionReq action) throws BBYException;

    FileActionResult deleteFile(String userId, FileActionReq action) throws BBYException;

    VirtualDirectory mkdir(String userId, String parent, String dirname) throws BBYException;

    void editPermission(String userId, EditPermissionReq req) throws BBYException;

    UserRootsVO getUserRoots(String userId, int page, int limit);

    VirtualObject getFileInfo(String userId, String fileId) throws BBYException;
    List<VirtualObject> getFileInfos(String userId, List<String> fileIds);

    String getFilePath(String userId, String fileId) throws BBYException;

    SearchFileVO search(String userId, String target, String keyword,String type, int page, int limit) throws BBYException;

    void reportFile(FileReport report) throws VirtualObjNotFoundException;

    Object classify(String userId, String category) throws BBYException;
}
